package com.xbongbong.pro.formdata.pojo.dto;

import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.UserVO;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.PositiveOrZero;

/**
 * 获取tab也没
 * @author 吴峰
 * @version v1.0
 * @date 2019/3/4 14:41
 * @since v1.0
 */
@Getter
@Setter
@ToString
public class FormDataDetailDTO extends BaseDTO {
    private static final long serialVersionUID = 1391352128361226149L;

    /**
     * 数据id
     */
    @NotNull(message = "{dto.msg.formDataDetail.dataId.NotNull}")
    private Long dataId;

    /**
     * saas标记
     */
    @DecimalMin(value = "1", message = "{dto.msg.processDelete.saasMark.DecimalMin}")
    @DecimalMax(value = "2", message = "{dto.msg.processDelete.saasMark.DecimalMax}")
    private Integer saasMark;

    /**
     * 业务类型
     */
    @PositiveOrZero(message = "{dto.msg.formDataDetail.businessType.PositiveOrZero}")
    private Integer businessType;
    /**
     * 业务类型
     */
    private Integer subBusinessType;
    /**
     * 菜单id
     */
    private Long menuId;

    /**
     * 知识库ID，知识库用
     */
    private Long knowledgeBaseId;
    /**
     * 数据创建人userId(校验团队时使用)
     */
    private String dataCreatorId;

    public FormDataDetailDTO() {
    }

    public FormDataDetailDTO(Long dataId, Integer saasMark, Integer businessType, Long menuId, String dataCreatorId, UserVO loginUser) {
        this.dataId = dataId;
        this.saasMark = saasMark;
        this.businessType = businessType;
        this.menuId = menuId;
        this.dataCreatorId = dataCreatorId;
        setLoginUser(loginUser);
    }
}
